home *** CD-ROM | disk | FTP | other *** search
- RSC2OBJ: (No exernal Resource file)
- """"""""
-
- RSC2OBJ creates a DRI compatible objekt format can link to your program.
- Calling: 'rsc2obj <rsc-file>.RSC <obj-file>.O LABEL -r
- <rsc-file>.RSC : Resorcefile.
- <rsc-file>.O : Objektfile.
- LABEL : Name(Identifier) for the RESOURCE.
- Declaration in C: extern RSHDR LABEL;
- (RSHDR is defined in aes.h).
- -r : [optional] Relocates the addresses in tree, this meens
- pointer to free_images, free_strings, tedinfo-structs.
- Must set if you are using the moduls in RESOURCE\ folder.
-
-
- Library functions:
- """"""""""""""""""
-
- int rsrc_shdr ( RSHDR *rsheader );
- int rsrc_ghdr ( RSHDR **rsheader );
- int rsrc_sobject( RSHDR *rsc, int re_gtype, int re_gindex, void *gaddr );
- int rsrc_gobject( RSHDR *rsc, int re_gtype, int re_gindex, void **gaddr );
-
-
- rsrc_shdr (ReSoRCe_SetHeaDeR):
- ------------------------------
- Make an 'rsrc_obfix()' to all objects of the given Resorce (rsheader).
- Install the Resource in the global-array ([5,6] = ap_ptree) like it is
- done by rsrc_load and put a pointer to the resource-header in the
- 'global'-array[3,4] and the lenght into global[9].
-
- RSHDR *rsheader : Pointer to the ResourceHeader of the Resource.
- <Returns> : 0 - ERROR
- 1 - OK
-
-
- rsrc_ghdr (ReSoRCe_GetHeaDeR):
- ------------------------------
- Get the Resource-header from 'global'-array ([3,4] = ap_pprivat).
-
- RSHDR **rsheader : Address of pointer to get the pointer of the
- ResourceHeader.
- <Returns> : 0 - ERROR
- 1 - OK
-
-
- rsrc_sobj (ReSoRCe_SetOBJect):
- ---------------------------------
- Identical with 'rsrc_saddr()' using ResourceHeaders.
-
- RSHDR *rsc : Pointer to the ResourceHeader.
- int re_gtype : Type of objekt. (look rsrc_saddr())
- int re_gindex : Index of objektes
- void *gaddr : Value.
- <Returns> : 0 - ERROR
- 1 - OK
-
-
- rsrc_gobj (ReSoRCe_GetOBJect):
- ------------------------------
- Identical with rsrc_gaddr() using ResourceHeadrs.
-
- RSHDR *rsc : Pointer to the ResourceHeader.
- int re_gtype : Type of objekt. (look rsrc_saddr())
- int re_gindex : Index of objektes
- void **gaddr : Returned value.
- <Returns> : 0 - ERROR
- 1 - OK
-
-
-
- ===========================================================================
-
- A pice of C:
- ------------
-
- extern RSHDR GEM_VIEW;
- :
- :
- rsrc_shdr (&GEM_VIEW); /* automatic rsrc_obfix() calls */
- if (_app) {
- rsrc_gaddr(R_TREE, GVIEWMNU, &menu);
- :
- :
- menu_bar(menu, 1);
- }
-
- ---------------------
- OR
- ---------------------
-
- #define IMGICON 0 /* Formular/Dialog */
- extern RSHDR ICON_IMG;
- :
- :
- {
- OBJECT *object;
- int i;
- object = *((OBJECT**)(ICON_IMG.rsh_trindex + (long)&ICON_IMG));
- for (i = 0; i < ICON_IMG.rsh_nobs; i++)
- #if CONSTANT
- {
- /* For ICONS (all) use HIGH_RES! */
- object[i].ob_x = 8 * (object[i].ob_x & 0x00FF) + ((object[i].ob_x >> 8) & 0x00FF);
- object[i].ob_y = 16 * (object[i].ob_y & 0x00FF) + ((object[i].ob_y >> 8) & 0x00FF);
- object[i].ob_width = 8 * (object[i].ob_width & 0x00FF) + ((object[i].ob_width >> 8) & 0x00FF);
- object[i].ob_height = 16 * (object[i].ob_height & 0x00FF) + ((object[i].ob_height >> 8) & 0x00FF);
- }
- #else
- rsrc_obfix(object, i);
- #endif
- }
- rsrc_gobject(&ICON_IMG, R_TREE, IMGICON, (void**) &iconTree);
-
- ---------------------
- No problems for more then one Resource in your next program.
-
-
- Dieter